#include <stdio.h>
#include <assert.h>

char* my_strncpy(char* dest, const char* src, size_t num)
{
	assert(dest && src);
	char* ret = dest;
	while (num--)
	{
		*dest++ = *src++;
	}
	return  ret;
}

int main()
{
	char p1[20] = {0};
	char p2[] = "l love you ";
	my_strncpy(p1, p2, 3);
	printf("%s", p1);
	return 0;
}